package wang.jinggo.util;

import java.math.BigInteger;
import java.security.MessageDigest;

public class MD5Util {
	private MD5Util() {
	}

	public static String encrypt(String str) {
		MessageDigest md;
		try {
			md = MessageDigest.getInstance("MD5");
			md.update(str.getBytes());
			return new BigInteger(1, md.digest()).toString(16);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
}
